package com.codechuan.hallo_internal.utils;

import android.content.Context;
import android.widget.Toast;

import androidx.appcompat.app.AlertDialog;

/**
 * @Deprecated 弹出框工具类
 */
public class DialogUtil {

    /**
     * @Deprecated 对话框弹出框
     * @param title 标题
     * @param msg 消息
     */
    public static AlertDialog.Builder showDialog(String title,String msg) {
        AlertDialog.Builder builder = new AlertDialog.Builder(ContextUtil.context);
        builder.setTitle(title);
        builder.setMessage(msg);
        // 设置确定按钮的点击事件
        builder.setPositiveButton("确定", (dialog, which) -> {
            // 点击确定按钮后的操作
        });
        // 设置取消按钮的点击事件
        builder.setNegativeButton("取消", (dialog, which) -> {
            // 点击取消按钮后的操作
        });
        return builder;
    }

    /**
     * @Deprecated 消息提示框
     * @param context 上下文
     * @param msg 消息
     */
    public  static void showDialog(Context context, String msg) {
        Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
    }
}
